package com.wit.witmg.api;


import com.wit.witmg.annotation.PassToken;
import com.wit.witmg.service.ITMgrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2025-06-10
 */
@RestController
@RequestMapping("mgr")
@Api(tags = "4GMgr API")
@RequiredArgsConstructor
public class MgrController {
    final ITMgrService service;
    @ApiOperation("添加")
    @PostMapping("add")
    @PassToken
    public Object add(HttpServletRequest request,
                      @RequestBody String json) {
        return service.add(request,json);
    }

    @ApiOperation("查询")
    @PostMapping("get")
    public Object get(HttpServletRequest request,
                      @RequestParam("id") String id,
                      @RequestParam("dt0") Long dt0,
                      @RequestParam("dt1") Long dt1) {
        return service.get(request,id,dt0,dt1);
    }
}
